package com.yaiys.jvm;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class OOMTest {

    // JVM设置
    // -Xms10M -Xmx10M -XX:+PrintGCDetails -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\jvm.dump
    public static void main(String[] args) {
        List<User> list = new ArrayList<User>();
        int i = 0;
        int j = 0;
        while (true) {
            list.add(new User(i++, UUID.randomUUID()));
            new User(j--, UUID.randomUUID());
            int math=Math.floorMod(101,10);
            System.out.println(i+"----------------"+math);
        }
    }
}